<?php

class ItemRequest extends Eloquent {
	protected $table="item_requests";
	protected $primaryKey = "pk";
	protected $fillable = [];

	public function requestedBy()
	{
		return $this->belongsTo('User', 'requested_by_fk', 'pk');
	}
	public function approvedBy()
	{
		return $this->belongsTo('User', 'approved_by_fk', 'pk');
	}
	public function requestType()
	{
		return $this->belongsTo('ItemRequestType', 'request_type_fk', 'pk');
	}
	public function requestStatus()
	{
		return $this->belongsTo('ItemRequestStatus', 'request_status_fk', 'pk');
	}

	public function requestItems()
	{
		return $this->hasMany('ItemRequestItem', 'request_fk', 'pk');
	}
}
?>